% ReadMonitorData: Read the monitor data from the h5filename
%
% INPUTS: 
%   - chan_name_list: string or cell array of string containing the list of
%     the names of the channel to be read
% OUTPUTS:
%
% T. Vanderbruggen, 19/02/2014
function res = ReadMonitorData(h5filename, chan_name_list)
    monitor_data = hdf5read(h5filename, '/Monitor/ai');
    
    if ischar(chan_name_list)
        res = monitor_data(GetChannelNum(chan_name_list));
    elseif iscell(chan_name_list)
        res = cell(1,length(chan_name_list));
        for k = 1:length(chan_name_list)
            res{k} = monitor_data(GetChannelNum(chan_name_list{k}));
        end
    else
        error('The channel name must be either a string or a cell of strings');
    end
end
        
